﻿using System.Collections.Generic;
using BaseSyntax.Values.StringTest.Yaml.Parsers;

namespace BaseSyntax.Values.StringTest.Yaml.Configs
{
	public static class ParserMap
	{
		static Dictionary<string, IParser> d1 = new Dictionary<string, IParser>();

		static ParserMap()
		{
			d1["GameObject"] = new GameObjParser();
			d1["RectTransform"] = new RectTransformParser();
			
			d1["Image"] = new ImageParser();
			
			d1["Text"] = new TextParser();
		}
		
		public static IParser GetMap(string objTypeName = null)
		{
			if (objTypeName == null)
			{
				return null;
			}
			if (d1.ContainsKey(objTypeName))
			{
				return d1[objTypeName];
			}

			return null;
		}
		
		
	}
}